LIBS = -lGL -lGLU -lSDL -lSDL_mixer -lIL -lILU -lILUT -lfreetype `freetype-config --cflags`

OPTIMIIZATIONS = 
									#-O3 -funroll-loops
CXXFLAGS =  -c $(GL) $(OPTIMIIZATIONS)
EXTRA_CFLAGS = `freetype-config --cflags`
LFLAGS = -L.

CC = g++



EXAMPLES = examples/helloWorld.cpp
EXTERNAL = src/external/GLFT_Font.cpp src/external/GLee.c

SOURCES = src/Color.cpp src/Data.cpp src/Engine.cpp src/Node.cpp src/Point.cpp \
          src/Scene.cpp src/Texture.cpp src/Utils.cpp src/PrimitiveNode.cpp \
          src/Camera.cpp src/TexturedNode.cpp src/Timer.cpp src/FontNode.cpp\
          src/Particles/Particle.cpp src/Particles/ParticleEmitter.cpp\
          src/Particles/ParticleEngine.cpp src/SoundEngine.cpp src/PostProcessor.cpp \
          $(EXAMPLES) $(EXTERNAL)

DEPENDANT_HEADERS =  include/Vector2.hpp include/Rectangle.hpp include/Defines.hpp
  
TARGET = examples/helloWorld
LIB_TARGET = libklas.a

OBJp1 = $(SOURCES:.cpp=.o)
OBJECTS = $(OBJp1:.c=.o)

all: $(TARGET) library

$(TARGET): $(OBJECTS) $(DEPENDANT_HEADERS)
	$(CC) $(LFLAGS) $(OPTIMIIZATIONS) -o $(TARGET) $(OBJECTS) $(LIBS)

library:
	ar rcs $(LIB_TARGET) $(OBJECTS)
	#nm libklas.a
	
clean:
	rm src/*.o

